package eu.webhib.webblog.domain;

import java.util.*;
import javax.persistence.*;
import org.apache.log4j.Logger;

import eu.webhib.webblog.domain.base.CommonBaseEntityImpl;

//
@javax.persistence.Entity
@javax.persistence.NamedQueries({
   @javax.persistence.NamedQuery(name = "Media_All", query = "SELECT m FROM Media m")
})
@Access(AccessType.FIELD)
public class Media extends CommonBaseEntityImpl {
   //
   private static final Logger log = Logger.getLogger(Media.class);
   // attributes
   @Column(nullable = false)
   private String title;
   @Column(nullable = true)
   private String description;
   @Column(nullable = false)
   private String relativeFilePath;
   @Temporal(javax.persistence.TemporalType.TIMESTAMP)
   private Date uploaded;
   // relations
   @ManyToOne(optional = false, fetch = FetchType.LAZY)
   Posting posting;

   //
   // getter/setter
   //

   public String getLabel() {
      return title;
   }

   public String getTitle() {
      return title;
   }

   public void setTitle(String title) {
      this.title = title;
   }

   public String getDescription() {
      return description;
   }

   public void setDescription(String description) {
      this.description = description;
   }

   public String getRelativeFilePath() {
      return relativeFilePath;
   }

   public void setRelativeFilePath(String relativeFilePath) {
      this.relativeFilePath = relativeFilePath;
   }

   public Date getUploaded() {
      return uploaded;
   }

   public void setUploaded(Date uploaded) {
      this.uploaded = uploaded;
   }

   public Posting getPosting() {
      return posting;
   }

   public void setPosting(Posting posting) {
      this.posting = posting;
   }
}
